#!/usr/bin/env bash
# syscat
# a info script thrown together
# created by Nero (ssh-dw)

f=3 b=4
for j in f b; do
  for i in {0..7}; do
    printf -v $j$i %b "\e[${!j}${i}m"
  done
done

B='[1m'
R='[0m'
I='[7m'

USR=$(whoami)
HOS=$(hostname)
OS1=$(cat /etc/os-release | awk 'NR==1' | awk -F '"' '{print $2}' | tr -d '\n') 
OS2=$(echo 64bit) # i use arch so my os doesn't have a version
KRN=$(uname -rms)
CPU=$(cat /proc/cpuinfo | grep 'model name' | uniq | sed -n 's/.*: //p' | tr -d '\n')
UPT=$(uptime | awk -F, '{sub(".*up ",x,$1);print $1}' | sed -e 's/^[ \t]*//')
PKG=$(pacman -Q | wc -l) # i use arch so pacman
TX1=Uptime
TX2=Packages

if [ "$1" = "-c" ] || [ "$1" = "-color" ]
then

cat << EOF

$f6           ──────▄▀▄─────▄▀▄
$f6           ─────▄█░░▀▀▀▀▀░░█▄
$f6           ─▄▄──█░░░░░░░░░░░█──▄▄
$f6           █▄▄█─█░░▀░░┬░░▀░░█─█▄▄█$R
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
$f1   ▀▀▀▀▀$f2 ▀▀▀▀▀$f3 ▀▀▀▀▀$f4 ▀▀▀▀▀$f5 ▀▀▀▀▀$f6 ▀▀▀▀▀$f7 ▀▀▀▀▀ 
$B$f1   ▀▀▀▀▀$f2 ▀▀▀▀▀$f3 ▀▀▀▀▀$f4 ▀▀▀▀▀$f5 ▀▀▀▀▀$f6 ▀▀▀▀▀$f7 ▀▀▀▀▀$R
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

EOF

else 

cat << EOF

$f6                ──────▄▀▄─────▄▀▄
$f6                ─────▄█░░▀▀▀▀▀░░█▄
$f6                ─▄▄──█░░░░░░░░░░░█──▄▄
$f6                █▄▄█─█░░▀░░┬░░▀░░█─█▄▄█$R
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
        $f1$USR$f3@$f4$HOS
        $f5$OS1 $f3$OS2
        $f4$KRN
        $f5$CPU
        $f4$TX1 $f3$UPT 
        $f5$PKG $f2$TX2$R
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

EOF
fi


